 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKJdccs/JdccsModel.h>

@implementation Statistic
-(id) initWithMax:(NSNumber*) max
      min:(NSNumber*)min
      avg:(NSNumber*)avg { 
     self.max = max;               
     self.min = min;               
     self.avg = avg;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self max])
    {
        [result setValue:[self max] forKey:@"max"];
    }
    if([self min])
    {
        [result setValue:[self min] forKey:@"min"];
    }
    if([self avg])
    {
        [result setValue:[self avg] forKey:@"avg"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.max = [dictionary objectForKey:@"max"];
    self.min = [dictionary objectForKey:@"min"];
    self.avg = [dictionary objectForKey:@"avg"];
    return self;
}
 @end
@implementation Metric
-(id) initWithMetricValue:(NSString*) metricValue
      metricName:(NSString*)metricName { 
     self.metricValue = metricValue;               
     self.metricName = metricName;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self metricValue])
    {
        [result setValue:[self metricValue] forKey:@"metric"];
    }
    if([self metricName])
    {
        [result setValue:[self metricName] forKey:@"metricName"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.metricValue = [dictionary objectForKey:@"metric"];
    self.metricName = [dictionary objectForKey:@"metricName"];
    return self;
}
 @end
@implementation DataPoint
-(id) initWithTimestamp:(NSNumber*) timestamp
      value:(NSNumber*)value { 
     self.timestamp = timestamp;               
     self.value = value;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self timestamp])
    {
        [result setValue:[self timestamp] forKey:@"timestamp"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.timestamp = [dictionary objectForKey:@"timestamp"];
    self.value = [dictionary objectForKey:@"value"];
    return self;
}
 @end
@implementation DescribeDevice
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      deviceId:(NSString*)deviceId
      snNo:(NSString*)snNo
      cabinetNo:(NSString*)cabinetNo
      rackUIndex:(NSString*)rackUIndex
      uNum:(NSNumber*)uNum
      brand:(NSString*)brand
      model:(NSString*)model
      deviceType:(NSString*)deviceType
      assetBelong:(NSString*)assetBelong
      assetStatus:(NSString*)assetStatus { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.deviceId = deviceId;               
     self.snNo = snNo;               
     self.cabinetNo = cabinetNo;               
     self.rackUIndex = rackUIndex;               
     self.uNum = uNum;               
     self.brand = brand;               
     self.model = model;               
     self.deviceType = deviceType;               
     self.assetBelong = assetBelong;               
     self.assetStatus = assetStatus;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self deviceId])
    {
        [result setValue:[self deviceId] forKey:@"deviceId"];
    }
    if([self snNo])
    {
        [result setValue:[self snNo] forKey:@"snNo"];
    }
    if([self cabinetNo])
    {
        [result setValue:[self cabinetNo] forKey:@"cabinetNo"];
    }
    if([self rackUIndex])
    {
        [result setValue:[self rackUIndex] forKey:@"rackUIndex"];
    }
    if([self uNum])
    {
        [result setValue:[self uNum] forKey:@"uNum"];
    }
    if([self brand])
    {
        [result setValue:[self brand] forKey:@"brand"];
    }
    if([self model])
    {
        [result setValue:[self model] forKey:@"model"];
    }
    if([self deviceType])
    {
        [result setValue:[self deviceType] forKey:@"deviceType"];
    }
    if([self assetBelong])
    {
        [result setValue:[self assetBelong] forKey:@"assetBelong"];
    }
    if([self assetStatus])
    {
        [result setValue:[self assetStatus] forKey:@"assetStatus"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.deviceId = [dictionary objectForKey:@"deviceId"];
    self.snNo = [dictionary objectForKey:@"snNo"];
    self.cabinetNo = [dictionary objectForKey:@"cabinetNo"];
    self.rackUIndex = [dictionary objectForKey:@"rackUIndex"];
    self.uNum = [dictionary objectForKey:@"uNum"];
    self.brand = [dictionary objectForKey:@"brand"];
    self.model = [dictionary objectForKey:@"model"];
    self.deviceType = [dictionary objectForKey:@"deviceType"];
    self.assetBelong = [dictionary objectForKey:@"assetBelong"];
    self.assetStatus = [dictionary objectForKey:@"assetStatus"];
    return self;
}
 @end
@implementation Alarm
-(id) initWithAlarmId:(NSString*) alarmId
      name:(NSString*)name
      idc:(NSString*)idc
      idcName:(NSString*)idcName
      resourceType:(NSString*)resourceType
      resourceId:(NSString*)resourceId
      resourceName:(NSString*)resourceName
      metric:(NSString*)metric
      metricName:(NSString*)metricName
      period:(NSNumber*)period
      statisticMethod:(NSString*)statisticMethod
      operatorValue:(NSString*)operatorValue
      threshold:(NSNumber*)threshold
      times:(NSNumber*)times
      noticePeriod:(NSNumber*)noticePeriod
      status:(NSString*)status
      switchboard:(NSArray<NSObject*>*)switchboard { 
     self.alarmId = alarmId;               
     self.name = name;               
     self.idc = idc;               
     self.idcName = idcName;               
     self.resourceType = resourceType;               
     self.resourceId = resourceId;               
     self.resourceName = resourceName;               
     self.metric = metric;               
     self.metricName = metricName;               
     self.period = period;               
     self.statisticMethod = statisticMethod;               
     self.operatorValue = operatorValue;               
     self.threshold = threshold;               
     self.times = times;               
     self.noticePeriod = noticePeriod;               
     self.status = status;               
     self.switchboard = switchboard;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self resourceName])
    {
        [result setValue:[self resourceName] forKey:@"resourceName"];
    }
    if([self metric])
    {
        [result setValue:[self metric] forKey:@"metric"];
    }
    if([self metricName])
    {
        [result setValue:[self metricName] forKey:@"metricName"];
    }
    if([self period])
    {
        [result setValue:[self period] forKey:@"period"];
    }
    if([self statisticMethod])
    {
        [result setValue:[self statisticMethod] forKey:@"statisticMethod"];
    }
    if([self operatorValue])
    {
        [result setValue:[self operatorValue] forKey:@"operator"];
    }
    if([self threshold])
    {
        [result setValue:[self threshold] forKey:@"threshold"];
    }
    if([self times])
    {
        [result setValue:[self times] forKey:@"times"];
    }
    if([self noticePeriod])
    {
        [result setValue:[self noticePeriod] forKey:@"noticePeriod"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self switchboard])
    {
        [result setValue:[self switchboard] forKey:@"switchboard"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    self.name = [dictionary objectForKey:@"name"];
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.resourceName = [dictionary objectForKey:@"resourceName"];
    self.metric = [dictionary objectForKey:@"metric"];
    self.metricName = [dictionary objectForKey:@"metricName"];
    self.period = [dictionary objectForKey:@"period"];
    self.statisticMethod = [dictionary objectForKey:@"statisticMethod"];
    self.operatorValue = [dictionary objectForKey:@"operator"];
    self.threshold = [dictionary objectForKey:@"threshold"];
    self.times = [dictionary objectForKey:@"times"];
    self.noticePeriod = [dictionary objectForKey:@"noticePeriod"];
    self.status = [dictionary objectForKey:@"status"];
    self.switchboard = [dictionary objectForKey:@"switchboard"];
    return self;
}
 @end
@implementation DescribeBandwidth
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      bandwidthId:(NSString*)bandwidthId
      bandwidthName:(NSString*)bandwidthName
      status:(NSString*)status
      lineType:(NSNumber*)lineType
      bandwidth:(NSNumber*)bandwidth
      relatedIp:(NSArray<NSObject*>*)relatedIp { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.bandwidthId = bandwidthId;               
     self.bandwidthName = bandwidthName;               
     self.status = status;               
     self.lineType = lineType;               
     self.bandwidth = bandwidth;               
     self.relatedIp = relatedIp;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self bandwidthId])
    {
        [result setValue:[self bandwidthId] forKey:@"bandwidthId"];
    }
    if([self bandwidthName])
    {
        [result setValue:[self bandwidthName] forKey:@"bandwidthName"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self lineType])
    {
        [result setValue:[self lineType] forKey:@"lineType"];
    }
    if([self bandwidth])
    {
        [result setValue:[self bandwidth] forKey:@"bandwidth"];
    }
    if([self relatedIp])
    {
        [result setValue:[self relatedIp] forKey:@"relatedIp"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.bandwidthId = [dictionary objectForKey:@"bandwidthId"];
    self.bandwidthName = [dictionary objectForKey:@"bandwidthName"];
    self.status = [dictionary objectForKey:@"status"];
    self.lineType = [dictionary objectForKey:@"lineType"];
    self.bandwidth = [dictionary objectForKey:@"bandwidth"];
    self.relatedIp = [dictionary objectForKey:@"relatedIp"];
    return self;
}
 @end
@implementation LastDownsampleRespItem
-(id) initWithMetric:(NSString*) metric
      resourceId:(NSString*)resourceId
      value:(NSNumber*)value { 
     self.metric = metric;               
     self.resourceId = resourceId;               
     self.value = value;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self metric])
    {
        [result setValue:[self metric] forKey:@"metric"];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.metric = [dictionary objectForKey:@"metric"];
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.value = [dictionary objectForKey:@"value"];
    return self;
}
 @end
@implementation DescribeCabinet
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      cabinetId:(NSString*)cabinetId
      cabinetNo:(NSString*)cabinetNo
      roomNo:(NSString*)roomNo
      cabinetSpace:(NSNumber*)cabinetSpace
      cabinetPower:(NSNumber*)cabinetPower
      cabinetType:(NSString*)cabinetType
      cabinetOpenStatus:(NSString*)cabinetOpenStatus
      cabinetOpenTime:(NSString*)cabinetOpenTime
      startTime:(NSString*)startTime
      endTime:(NSString*)endTime { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.cabinetId = cabinetId;               
     self.cabinetNo = cabinetNo;               
     self.roomNo = roomNo;               
     self.cabinetSpace = cabinetSpace;               
     self.cabinetPower = cabinetPower;               
     self.cabinetType = cabinetType;               
     self.cabinetOpenStatus = cabinetOpenStatus;               
     self.cabinetOpenTime = cabinetOpenTime;               
     self.startTime = startTime;               
     self.endTime = endTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self cabinetId])
    {
        [result setValue:[self cabinetId] forKey:@"cabinetId"];
    }
    if([self cabinetNo])
    {
        [result setValue:[self cabinetNo] forKey:@"cabinetNo"];
    }
    if([self roomNo])
    {
        [result setValue:[self roomNo] forKey:@"roomNo"];
    }
    if([self cabinetSpace])
    {
        [result setValue:[self cabinetSpace] forKey:@"cabinetSpace"];
    }
    if([self cabinetPower])
    {
        [result setValue:[self cabinetPower] forKey:@"cabinetPower"];
    }
    if([self cabinetType])
    {
        [result setValue:[self cabinetType] forKey:@"cabinetType"];
    }
    if([self cabinetOpenStatus])
    {
        [result setValue:[self cabinetOpenStatus] forKey:@"cabinetOpenStatus"];
    }
    if([self cabinetOpenTime])
    {
        [result setValue:[self cabinetOpenTime] forKey:@"cabinetOpenTime"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.cabinetId = [dictionary objectForKey:@"cabinetId"];
    self.cabinetNo = [dictionary objectForKey:@"cabinetNo"];
    self.roomNo = [dictionary objectForKey:@"roomNo"];
    self.cabinetSpace = [dictionary objectForKey:@"cabinetSpace"];
    self.cabinetPower = [dictionary objectForKey:@"cabinetPower"];
    self.cabinetType = [dictionary objectForKey:@"cabinetType"];
    self.cabinetOpenStatus = [dictionary objectForKey:@"cabinetOpenStatus"];
    self.cabinetOpenTime = [dictionary objectForKey:@"cabinetOpenTime"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    return self;
}
 @end
@implementation Ticket
-(id) initWithTicketNo:(NSString*) ticketNo
      ticketTemplateName:(NSString*)ticketTemplateName
      ticketTemplateCode:(NSString*)ticketTemplateCode
      ticketTypeName:(NSString*)ticketTypeName
      status:(NSString*)status
      descriptionValue:(NSString*)descriptionValue
      createdTime:(NSString*)createdTime
      closedTime:(NSString*)closedTime
      phone:(NSString*)phone
      email:(NSString*)email
      idc:(NSString*)idc
      idcName:(NSString*)idcName { 
     self.ticketNo = ticketNo;               
     self.ticketTemplateName = ticketTemplateName;               
     self.ticketTemplateCode = ticketTemplateCode;               
     self.ticketTypeName = ticketTypeName;               
     self.status = status;               
     self.descriptionValue = descriptionValue;               
     self.createdTime = createdTime;               
     self.closedTime = closedTime;               
     self.phone = phone;               
     self.email = email;               
     self.idc = idc;               
     self.idcName = idcName;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ticketNo])
    {
        [result setValue:[self ticketNo] forKey:@"ticketNo"];
    }
    if([self ticketTemplateName])
    {
        [result setValue:[self ticketTemplateName] forKey:@"ticketTemplateName"];
    }
    if([self ticketTemplateCode])
    {
        [result setValue:[self ticketTemplateCode] forKey:@"ticketTemplateCode"];
    }
    if([self ticketTypeName])
    {
        [result setValue:[self ticketTypeName] forKey:@"ticketTypeName"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self createdTime])
    {
        [result setValue:[self createdTime] forKey:@"createdTime"];
    }
    if([self closedTime])
    {
        [result setValue:[self closedTime] forKey:@"closedTime"];
    }
    if([self phone])
    {
        [result setValue:[self phone] forKey:@"phone"];
    }
    if([self email])
    {
        [result setValue:[self email] forKey:@"email"];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ticketNo = [dictionary objectForKey:@"ticketNo"];
    self.ticketTemplateName = [dictionary objectForKey:@"ticketTemplateName"];
    self.ticketTemplateCode = [dictionary objectForKey:@"ticketTemplateCode"];
    self.ticketTypeName = [dictionary objectForKey:@"ticketTypeName"];
    self.status = [dictionary objectForKey:@"status"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.createdTime = [dictionary objectForKey:@"createdTime"];
    self.closedTime = [dictionary objectForKey:@"closedTime"];
    self.phone = [dictionary objectForKey:@"phone"];
    self.email = [dictionary objectForKey:@"email"];
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    return self;
}
 @end
@implementation Device
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      deviceId:(NSString*)deviceId
      snNo:(NSString*)snNo
      cabinetNo:(NSString*)cabinetNo
      rackUIndex:(NSString*)rackUIndex
      uNum:(NSNumber*)uNum
      brand:(NSString*)brand
      model:(NSString*)model
      deviceType:(NSString*)deviceType
      assetBelong:(NSString*)assetBelong
      assetStatus:(NSString*)assetStatus
      cpuCore:(NSString*)cpuCore
      memory:(NSString*)memory
      disk:(NSString*)disk
      networkCardBandwidth:(NSString*)networkCardBandwidth
      startTime:(NSString*)startTime
      endTime:(NSString*)endTime { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.deviceId = deviceId;               
     self.snNo = snNo;               
     self.cabinetNo = cabinetNo;               
     self.rackUIndex = rackUIndex;               
     self.uNum = uNum;               
     self.brand = brand;               
     self.model = model;               
     self.deviceType = deviceType;               
     self.assetBelong = assetBelong;               
     self.assetStatus = assetStatus;               
     self.cpuCore = cpuCore;               
     self.memory = memory;               
     self.disk = disk;               
     self.networkCardBandwidth = networkCardBandwidth;               
     self.startTime = startTime;               
     self.endTime = endTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self deviceId])
    {
        [result setValue:[self deviceId] forKey:@"deviceId"];
    }
    if([self snNo])
    {
        [result setValue:[self snNo] forKey:@"snNo"];
    }
    if([self cabinetNo])
    {
        [result setValue:[self cabinetNo] forKey:@"cabinetNo"];
    }
    if([self rackUIndex])
    {
        [result setValue:[self rackUIndex] forKey:@"rackUIndex"];
    }
    if([self uNum])
    {
        [result setValue:[self uNum] forKey:@"uNum"];
    }
    if([self brand])
    {
        [result setValue:[self brand] forKey:@"brand"];
    }
    if([self model])
    {
        [result setValue:[self model] forKey:@"model"];
    }
    if([self deviceType])
    {
        [result setValue:[self deviceType] forKey:@"deviceType"];
    }
    if([self assetBelong])
    {
        [result setValue:[self assetBelong] forKey:@"assetBelong"];
    }
    if([self assetStatus])
    {
        [result setValue:[self assetStatus] forKey:@"assetStatus"];
    }
    if([self cpuCore])
    {
        [result setValue:[self cpuCore] forKey:@"cpuCore"];
    }
    if([self memory])
    {
        [result setValue:[self memory] forKey:@"memory"];
    }
    if([self disk])
    {
        [result setValue:[self disk] forKey:@"disk"];
    }
    if([self networkCardBandwidth])
    {
        [result setValue:[self networkCardBandwidth] forKey:@"networkCardBandwidth"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.deviceId = [dictionary objectForKey:@"deviceId"];
    self.snNo = [dictionary objectForKey:@"snNo"];
    self.cabinetNo = [dictionary objectForKey:@"cabinetNo"];
    self.rackUIndex = [dictionary objectForKey:@"rackUIndex"];
    self.uNum = [dictionary objectForKey:@"uNum"];
    self.brand = [dictionary objectForKey:@"brand"];
    self.model = [dictionary objectForKey:@"model"];
    self.deviceType = [dictionary objectForKey:@"deviceType"];
    self.assetBelong = [dictionary objectForKey:@"assetBelong"];
    self.assetStatus = [dictionary objectForKey:@"assetStatus"];
    self.cpuCore = [dictionary objectForKey:@"cpuCore"];
    self.memory = [dictionary objectForKey:@"memory"];
    self.disk = [dictionary objectForKey:@"disk"];
    self.networkCardBandwidth = [dictionary objectForKey:@"networkCardBandwidth"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    return self;
}
 @end
@implementation Bandwidth
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      bandwidthId:(NSString*)bandwidthId
      bandwidthName:(NSString*)bandwidthName
      status:(NSString*)status
      lineType:(NSNumber*)lineType
      bandwidthValue:(NSNumber*)bandwidthValue
      relatedIp:(NSArray<NSObject*>*)relatedIp
      switchboard:(NSArray<NSObject*>*)switchboard { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.bandwidthId = bandwidthId;               
     self.bandwidthName = bandwidthName;               
     self.status = status;               
     self.lineType = lineType;               
     self.bandwidthValue = bandwidthValue;               
     self.relatedIp = relatedIp;               
     self.switchboard = switchboard;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self bandwidthId])
    {
        [result setValue:[self bandwidthId] forKey:@"bandwidthId"];
    }
    if([self bandwidthName])
    {
        [result setValue:[self bandwidthName] forKey:@"bandwidthName"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self lineType])
    {
        [result setValue:[self lineType] forKey:@"lineType"];
    }
    if([self bandwidthValue])
    {
        [result setValue:[self bandwidthValue] forKey:@"bandwidth"];
    }
    if([self relatedIp])
    {
        [result setValue:[self relatedIp] forKey:@"relatedIp"];
    }
    if([self switchboard])
    {
        [result setValue:[self switchboard] forKey:@"switchboard"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.bandwidthId = [dictionary objectForKey:@"bandwidthId"];
    self.bandwidthName = [dictionary objectForKey:@"bandwidthName"];
    self.status = [dictionary objectForKey:@"status"];
    self.lineType = [dictionary objectForKey:@"lineType"];
    self.bandwidthValue = [dictionary objectForKey:@"bandwidth"];
    self.relatedIp = [dictionary objectForKey:@"relatedIp"];
    self.switchboard = [dictionary objectForKey:@"switchboard"];
    return self;
}
 @end
@implementation Idc
-(id) initWithIdcValue:(NSString*) idcValue
      idcName:(NSString*)idcName { 
     self.idcValue = idcValue;               
     self.idcName = idcName;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idcValue])
    {
        [result setValue:[self idcValue] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idcValue = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    return self;
}
 @end
@implementation BandwidthTraffic
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      bandwidthId:(NSString*)bandwidthId
      bandwidthName:(NSString*)bandwidthName
      totalTrafficIn:(NSNumber*)totalTrafficIn
      totalTrafficOut:(NSNumber*)totalTrafficOut
      bandwidth:(NSNumber*)bandwidth
      lineType:(NSString*)lineType
      relatedIp:(NSArray<NSObject*>*)relatedIp
      switchboard:(NSArray<NSObject*>*)switchboard { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.bandwidthId = bandwidthId;               
     self.bandwidthName = bandwidthName;               
     self.totalTrafficIn = totalTrafficIn;               
     self.totalTrafficOut = totalTrafficOut;               
     self.bandwidth = bandwidth;               
     self.lineType = lineType;               
     self.relatedIp = relatedIp;               
     self.switchboard = switchboard;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self bandwidthId])
    {
        [result setValue:[self bandwidthId] forKey:@"bandwidthId"];
    }
    if([self bandwidthName])
    {
        [result setValue:[self bandwidthName] forKey:@"bandwidthName"];
    }
    if([self totalTrafficIn])
    {
        [result setValue:[self totalTrafficIn] forKey:@"totalTrafficIn"];
    }
    if([self totalTrafficOut])
    {
        [result setValue:[self totalTrafficOut] forKey:@"totalTrafficOut"];
    }
    if([self bandwidth])
    {
        [result setValue:[self bandwidth] forKey:@"bandwidth"];
    }
    if([self lineType])
    {
        [result setValue:[self lineType] forKey:@"lineType"];
    }
    if([self relatedIp])
    {
        [result setValue:[self relatedIp] forKey:@"relatedIp"];
    }
    if([self switchboard])
    {
        [result setValue:[self switchboard] forKey:@"switchboard"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.bandwidthId = [dictionary objectForKey:@"bandwidthId"];
    self.bandwidthName = [dictionary objectForKey:@"bandwidthName"];
    self.totalTrafficIn = [dictionary objectForKey:@"totalTrafficIn"];
    self.totalTrafficOut = [dictionary objectForKey:@"totalTrafficOut"];
    self.bandwidth = [dictionary objectForKey:@"bandwidth"];
    self.lineType = [dictionary objectForKey:@"lineType"];
    self.relatedIp = [dictionary objectForKey:@"relatedIp"];
    self.switchboard = [dictionary objectForKey:@"switchboard"];
    return self;
}
 @end
@implementation Ip
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      ipId:(NSString*)ipId
      cidrAddr:(NSString*)cidrAddr
      networkAddr:(NSString*)networkAddr
      gatewayAddr:(NSNumber*)gatewayAddr
      broadcastAddr:(NSNumber*)broadcastAddr
      status:(NSString*)status { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.ipId = ipId;               
     self.cidrAddr = cidrAddr;               
     self.networkAddr = networkAddr;               
     self.gatewayAddr = gatewayAddr;               
     self.broadcastAddr = broadcastAddr;               
     self.status = status;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self ipId])
    {
        [result setValue:[self ipId] forKey:@"ipId"];
    }
    if([self cidrAddr])
    {
        [result setValue:[self cidrAddr] forKey:@"cidrAddr"];
    }
    if([self networkAddr])
    {
        [result setValue:[self networkAddr] forKey:@"networkAddr"];
    }
    if([self gatewayAddr])
    {
        [result setValue:[self gatewayAddr] forKey:@"gatewayAddr"];
    }
    if([self broadcastAddr])
    {
        [result setValue:[self broadcastAddr] forKey:@"broadcastAddr"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.ipId = [dictionary objectForKey:@"ipId"];
    self.cidrAddr = [dictionary objectForKey:@"cidrAddr"];
    self.networkAddr = [dictionary objectForKey:@"networkAddr"];
    self.gatewayAddr = [dictionary objectForKey:@"gatewayAddr"];
    self.broadcastAddr = [dictionary objectForKey:@"broadcastAddr"];
    self.status = [dictionary objectForKey:@"status"];
    return self;
}
 @end
@implementation DescribeBandwidthTraffic
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      bandwidthId:(NSString*)bandwidthId
      bandwidthName:(NSString*)bandwidthName
      totalTrafficIn:(NSNumber*)totalTrafficIn
      totalTrafficOut:(NSNumber*)totalTrafficOut
      bandwidth:(NSNumber*)bandwidth { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.bandwidthId = bandwidthId;               
     self.bandwidthName = bandwidthName;               
     self.totalTrafficIn = totalTrafficIn;               
     self.totalTrafficOut = totalTrafficOut;               
     self.bandwidth = bandwidth;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self bandwidthId])
    {
        [result setValue:[self bandwidthId] forKey:@"bandwidthId"];
    }
    if([self bandwidthName])
    {
        [result setValue:[self bandwidthName] forKey:@"bandwidthName"];
    }
    if([self totalTrafficIn])
    {
        [result setValue:[self totalTrafficIn] forKey:@"totalTrafficIn"];
    }
    if([self totalTrafficOut])
    {
        [result setValue:[self totalTrafficOut] forKey:@"totalTrafficOut"];
    }
    if([self bandwidth])
    {
        [result setValue:[self bandwidth] forKey:@"bandwidth"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.bandwidthId = [dictionary objectForKey:@"bandwidthId"];
    self.bandwidthName = [dictionary objectForKey:@"bandwidthName"];
    self.totalTrafficIn = [dictionary objectForKey:@"totalTrafficIn"];
    self.totalTrafficOut = [dictionary objectForKey:@"totalTrafficOut"];
    self.bandwidth = [dictionary objectForKey:@"bandwidth"];
    return self;
}
 @end
@implementation Room
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      roomNo:(NSString*)roomNo { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.roomNo = roomNo;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self roomNo])
    {
        [result setValue:[self roomNo] forKey:@"roomNo"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.roomNo = [dictionary objectForKey:@"roomNo"];
    return self;
}
 @end
@implementation Cabinet
-(id) initWithIdc:(NSString*) idc
      idcName:(NSString*)idcName
      cabinetId:(NSString*)cabinetId
      cabinetNo:(NSString*)cabinetNo
      roomNo:(NSString*)roomNo
      cabinetSpace:(NSNumber*)cabinetSpace
      cabinetPower:(NSNumber*)cabinetPower
      cabinetType:(NSString*)cabinetType
      cabinetOpenStatus:(NSString*)cabinetOpenStatus
      cabinetOpenTime:(NSString*)cabinetOpenTime
      startTime:(NSString*)startTime
      endTime:(NSString*)endTime
      deviceNum:(NSNumber*)deviceNum
      rackUOccupy:(NSNumber*)rackUOccupy
      rackUFree:(NSNumber*)rackUFree { 
     self.idc = idc;               
     self.idcName = idcName;               
     self.cabinetId = cabinetId;               
     self.cabinetNo = cabinetNo;               
     self.roomNo = roomNo;               
     self.cabinetSpace = cabinetSpace;               
     self.cabinetPower = cabinetPower;               
     self.cabinetType = cabinetType;               
     self.cabinetOpenStatus = cabinetOpenStatus;               
     self.cabinetOpenTime = cabinetOpenTime;               
     self.startTime = startTime;               
     self.endTime = endTime;               
     self.deviceNum = deviceNum;               
     self.rackUOccupy = rackUOccupy;               
     self.rackUFree = rackUFree;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self cabinetId])
    {
        [result setValue:[self cabinetId] forKey:@"cabinetId"];
    }
    if([self cabinetNo])
    {
        [result setValue:[self cabinetNo] forKey:@"cabinetNo"];
    }
    if([self roomNo])
    {
        [result setValue:[self roomNo] forKey:@"roomNo"];
    }
    if([self cabinetSpace])
    {
        [result setValue:[self cabinetSpace] forKey:@"cabinetSpace"];
    }
    if([self cabinetPower])
    {
        [result setValue:[self cabinetPower] forKey:@"cabinetPower"];
    }
    if([self cabinetType])
    {
        [result setValue:[self cabinetType] forKey:@"cabinetType"];
    }
    if([self cabinetOpenStatus])
    {
        [result setValue:[self cabinetOpenStatus] forKey:@"cabinetOpenStatus"];
    }
    if([self cabinetOpenTime])
    {
        [result setValue:[self cabinetOpenTime] forKey:@"cabinetOpenTime"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self deviceNum])
    {
        [result setValue:[self deviceNum] forKey:@"deviceNum"];
    }
    if([self rackUOccupy])
    {
        [result setValue:[self rackUOccupy] forKey:@"rackUOccupy"];
    }
    if([self rackUFree])
    {
        [result setValue:[self rackUFree] forKey:@"rackUFree"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.cabinetId = [dictionary objectForKey:@"cabinetId"];
    self.cabinetNo = [dictionary objectForKey:@"cabinetNo"];
    self.roomNo = [dictionary objectForKey:@"roomNo"];
    self.cabinetSpace = [dictionary objectForKey:@"cabinetSpace"];
    self.cabinetPower = [dictionary objectForKey:@"cabinetPower"];
    self.cabinetType = [dictionary objectForKey:@"cabinetType"];
    self.cabinetOpenStatus = [dictionary objectForKey:@"cabinetOpenStatus"];
    self.cabinetOpenTime = [dictionary objectForKey:@"cabinetOpenTime"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.deviceNum = [dictionary objectForKey:@"deviceNum"];
    self.rackUOccupy = [dictionary objectForKey:@"rackUOccupy"];
    self.rackUFree = [dictionary objectForKey:@"rackUFree"];
    return self;
}
 @end
@implementation AlarmHistory
-(id) initWithAlarmId:(NSString*) alarmId
      name:(NSString*)name
      idc:(NSString*)idc
      idcName:(NSString*)idcName
      resourceType:(NSString*)resourceType
      resourceId:(NSString*)resourceId
      resourceName:(NSString*)resourceName
      metric:(NSString*)metric
      metricName:(NSString*)metricName
      period:(NSNumber*)period
      statisticMethod:(NSString*)statisticMethod
      operatorValue:(NSString*)operatorValue
      threshold:(NSNumber*)threshold
      times:(NSNumber*)times
      noticePeriod:(NSNumber*)noticePeriod
      status:(NSString*)status
      switchboard:(NSArray<NSObject*>*)switchboard
      alarmStatus:(NSString*)alarmStatus
      value:(NSNumber*)value
      noticeTime:(NSString*)noticeTime { 
     self.alarmId = alarmId;               
     self.name = name;               
     self.idc = idc;               
     self.idcName = idcName;               
     self.resourceType = resourceType;               
     self.resourceId = resourceId;               
     self.resourceName = resourceName;               
     self.metric = metric;               
     self.metricName = metricName;               
     self.period = period;               
     self.statisticMethod = statisticMethod;               
     self.operatorValue = operatorValue;               
     self.threshold = threshold;               
     self.times = times;               
     self.noticePeriod = noticePeriod;               
     self.status = status;               
     self.switchboard = switchboard;               
     self.alarmStatus = alarmStatus;               
     self.value = value;               
     self.noticeTime = noticeTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self resourceName])
    {
        [result setValue:[self resourceName] forKey:@"resourceName"];
    }
    if([self metric])
    {
        [result setValue:[self metric] forKey:@"metric"];
    }
    if([self metricName])
    {
        [result setValue:[self metricName] forKey:@"metricName"];
    }
    if([self period])
    {
        [result setValue:[self period] forKey:@"period"];
    }
    if([self statisticMethod])
    {
        [result setValue:[self statisticMethod] forKey:@"statisticMethod"];
    }
    if([self operatorValue])
    {
        [result setValue:[self operatorValue] forKey:@"operator"];
    }
    if([self threshold])
    {
        [result setValue:[self threshold] forKey:@"threshold"];
    }
    if([self times])
    {
        [result setValue:[self times] forKey:@"times"];
    }
    if([self noticePeriod])
    {
        [result setValue:[self noticePeriod] forKey:@"noticePeriod"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self switchboard])
    {
        [result setValue:[self switchboard] forKey:@"switchboard"];
    }
    if([self alarmStatus])
    {
        [result setValue:[self alarmStatus] forKey:@"alarmStatus"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    if([self noticeTime])
    {
        [result setValue:[self noticeTime] forKey:@"noticeTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    self.name = [dictionary objectForKey:@"name"];
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.resourceName = [dictionary objectForKey:@"resourceName"];
    self.metric = [dictionary objectForKey:@"metric"];
    self.metricName = [dictionary objectForKey:@"metricName"];
    self.period = [dictionary objectForKey:@"period"];
    self.statisticMethod = [dictionary objectForKey:@"statisticMethod"];
    self.operatorValue = [dictionary objectForKey:@"operator"];
    self.threshold = [dictionary objectForKey:@"threshold"];
    self.times = [dictionary objectForKey:@"times"];
    self.noticePeriod = [dictionary objectForKey:@"noticePeriod"];
    self.status = [dictionary objectForKey:@"status"];
    self.switchboard = [dictionary objectForKey:@"switchboard"];
    self.alarmStatus = [dictionary objectForKey:@"alarmStatus"];
    self.value = [dictionary objectForKey:@"value"];
    self.noticeTime = [dictionary objectForKey:@"noticeTime"];
    return self;
}
 @end
@implementation DescribeAlarm
-(id) initWithAlarmId:(NSString*) alarmId
      name:(NSString*)name
      idc:(NSString*)idc
      idcName:(NSString*)idcName
      resourceType:(NSString*)resourceType
      resourceId:(NSString*)resourceId
      resourceName:(NSString*)resourceName
      metric:(NSString*)metric
      metricName:(NSString*)metricName
      period:(NSNumber*)period
      statisticMethod:(NSString*)statisticMethod
      operatorValue:(NSString*)operatorValue
      threshold:(NSNumber*)threshold
      times:(NSNumber*)times
      noticePeriod:(NSNumber*)noticePeriod
      status:(NSString*)status { 
     self.alarmId = alarmId;               
     self.name = name;               
     self.idc = idc;               
     self.idcName = idcName;               
     self.resourceType = resourceType;               
     self.resourceId = resourceId;               
     self.resourceName = resourceName;               
     self.metric = metric;               
     self.metricName = metricName;               
     self.period = period;               
     self.statisticMethod = statisticMethod;               
     self.operatorValue = operatorValue;               
     self.threshold = threshold;               
     self.times = times;               
     self.noticePeriod = noticePeriod;               
     self.status = status;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self idc])
    {
        [result setValue:[self idc] forKey:@"idc"];
    }
    if([self idcName])
    {
        [result setValue:[self idcName] forKey:@"idcName"];
    }
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self resourceName])
    {
        [result setValue:[self resourceName] forKey:@"resourceName"];
    }
    if([self metric])
    {
        [result setValue:[self metric] forKey:@"metric"];
    }
    if([self metricName])
    {
        [result setValue:[self metricName] forKey:@"metricName"];
    }
    if([self period])
    {
        [result setValue:[self period] forKey:@"period"];
    }
    if([self statisticMethod])
    {
        [result setValue:[self statisticMethod] forKey:@"statisticMethod"];
    }
    if([self operatorValue])
    {
        [result setValue:[self operatorValue] forKey:@"operator"];
    }
    if([self threshold])
    {
        [result setValue:[self threshold] forKey:@"threshold"];
    }
    if([self times])
    {
        [result setValue:[self times] forKey:@"times"];
    }
    if([self noticePeriod])
    {
        [result setValue:[self noticePeriod] forKey:@"noticePeriod"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    self.name = [dictionary objectForKey:@"name"];
    self.idc = [dictionary objectForKey:@"idc"];
    self.idcName = [dictionary objectForKey:@"idcName"];
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.resourceName = [dictionary objectForKey:@"resourceName"];
    self.metric = [dictionary objectForKey:@"metric"];
    self.metricName = [dictionary objectForKey:@"metricName"];
    self.period = [dictionary objectForKey:@"period"];
    self.statisticMethod = [dictionary objectForKey:@"statisticMethod"];
    self.operatorValue = [dictionary objectForKey:@"operator"];
    self.threshold = [dictionary objectForKey:@"threshold"];
    self.times = [dictionary objectForKey:@"times"];
    self.noticePeriod = [dictionary objectForKey:@"noticePeriod"];
    self.status = [dictionary objectForKey:@"status"];
    return self;
}
 @end
@implementation MetricData
-(id) initWithData:(NSArray<DataPoint*>*) data
      statistic:(Statistic*)statistic
      metric:(Metric*)metric { 
     self.data = data;               
     self.statistic = statistic;               
     self.metric = metric;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self data])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self data] count]; i++) {
            DataPoint* item = [[self data] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"data"];
    }
    if([self statistic])
    {
        [result setValue:[[self statistic] dictionary]forKey:@"statistic"];
    }
    if([self metric])
    {
        [result setValue:[[self metric] dictionary]forKey:@"metric"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* dataArray = [dictionary objectForKey:@"data"];
    if(dataArray&&![dataArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataArray count];i++)
        {
            DataPoint* item = [[DataPoint alloc]initWithDic:[dataArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.data = propertyArray;
    }
    self.statistic = [[Statistic alloc]initWithDic:[dictionary objectForKey:@"statistic"]];
    self.metric = [[Metric alloc]initWithDic:[dictionary objectForKey:@"metric"]];
    return self;
}
 @end
 
 


